home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / communic / pcmail / main / pager.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-05  |  2.7 KB  |  80 lines

  1. /*++
  2. /* NAME
  3. /*    pager    5
  4. /* SUMMARY
  5. /*    pager for display files, definitions
  6. /* PROJECT
  7. /*    pc-mail
  8. /* PACKAGE
  9. /*    mail
  10. /* SYNOPSIS
  11. /*    #include "pager.h"
  12. /* DESCRIPTION
  13. /*    The display pager manipulates various lists of line structures.
  14. /*    Each line is linked to its predecessor and to its successor.
  15. /*
  16. /*    Besides the familiar list ops for insert/delete the pager also 
  17. /*    provides "read" and "write" operations on lines, and a 
  18. /*    sort utility.
  19. /* .nf
  20.  
  21.  /* externally visible parts of the pager */
  22.  
  23. #define    FORW_SORT    1        /* sort in ascending order */
  24. #define    BACK_SORT    2        /* sort in reverse order */
  25.  
  26. #define    PG_NOEND    1        /* suppress '-- end of display --' */
  27.  
  28. typedef struct File {
  29.     struct Line *head;            /* ptr to first line in file */
  30.     struct Line *last;            /* ditto to the last line */
  31.     struct Line *top;            /* first one visible on screen */
  32.     struct Line *curr;            /* where the cursor sits */
  33.     int     opts;            /* option flags */
  34. } File;
  35.  
  36. typedef struct Line {
  37.     struct Line *prev;            /* link to predecessor */
  38.     struct Line *next;            /* link to successor */
  39.     short   lineno;            /* where it is on the screen */
  40.     short   llen;            /* nbr of lines on the screen */
  41.     char    line[1];            /* actually, a lot of characters */
  42. } Line;
  43.  
  44. extern File *open_pager();        /* create a new display file */
  45. extern void close_pager();        /* destroys an display file */
  46. extern void appd_pager();        /* appends after current line */
  47. extern void del_pager();        /* delete current line */
  48. extern void ins_pager();        /* inserts before current line */
  49. extern void sort_pager();        /* sorts a file */
  50. extern void set_pager();        /* select display file */
  51. extern char *gets_pager();        /* returns current line */
  52. extern void puts_pager();        /* replaces current line */
  53.  
  54. extern int cp_pager();            /* copy display file to disk */
  55. extern int pr_pager();            /* copy display file to printer */
  56. extern int rd_pager();            /* permanent file to display file */
  57. extern int ds_pager();            /* current page of current file */
  58. extern int up_pager();            /* handle cursor up request */
  59. extern int dn_pager();            /* handle cursor down request */
  60. extern int pu_pager();            /* handle page up request */
  61. extern int pd_pager();            /* handle page down request */
  62. extern void mesg_pager();        /* copy message array to display file */
  63.  
  64. /* SEE ALSO
  65. /*    path(3), window(3), window(5)
  66. /* BUGS
  67. /*    It looks a lot like an editor, but it isn't.
  68. /* AUTHOR(S)
  69. /*    W.Z. Venema
  70. /*    Eindhoven University of Technology
  71. /*    Department of Mathematics and Computer Science
  72. /*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  73. /* CREATION DATE
  74. /*    Fri Apr  3 22:06:00 GMT+1:00 1987
  75. /* LAST MODIFICATION
  76. /*    90/01/22 13:02:23
  77. /* VERSION/RELEASE
  78. /*    2.1
  79. /*--*/
  80.